<style>
    .defDiv{
        background-color:#FFF;color:#333333;
    }
    .bgDiv0{
        background:#e6a23c;color:#FFF;
    }
    .bgDiv1{
        background:#F00;color:#FFF;
    }
    .bgDiv2{
        background:#409eff;color:#FFF;
    }
    .bgDiv3{
        background:#85ce61;color:#FFF;
    }
    .bgDiv4{
        background:#a6a9ad;color:#FFF;
    }
    .sex_0{
        background:#efefef;text-align: center;
        border-radius:10px;
    }
    .sex_1{
        background:#3bb4f2;text-align: center;
        border-radius:10px;
    }
    .sex_2{
        background:pink;text-align: center;
        border-radius:10px;
    }
    .tabGB0{
        background:#e6a23c;color:#FFF;padding:10px;
    }
    .tabGB1{
        background:#F00;color:#FFF !important;padding:10px;
    }
    .tabGB2{
        background:#409eff;color:#FFF;padding:10px;
    }
    .tabGB3{
        background:#85ce61;color:#FFF;padding:10px;
    }
    .tabGB4{
        background:#a6a9ad;color:#FFF;padding:10px;
    }
    .tabGBDel{
        background:#666;color:#FFF;padding:10px;
    }
    .tabGBDel2{
        background:#333;color:#FFF;padding:10px;
    }
    #beizhu .el-form-item__content{width:100% !important;}
    .el-checkbox__input{border:2px solid #999 !important;}
    #showStart .el-rate__item{width:15px !important;}
    /*.el-table__body-wrapper::-webkit-scrollbar {*/
    /*    height: 10px;  !* 改变滚动条的高度 *!*/
    /*}*/
    .keY0{background:#efefef;color:#FFF;width:35px;height:35px;line-height:35px;border-radius:50%;text-align:center;font-size:12px;}
    .keY10{background:#00c233;color:#FFF;width:35px;height:35px;line-height:35px;border-radius:50%;text-align:center;font-size:12px;}
    .keY20{background:#666666;color:#FFF;width:35px;height:35px;line-height:35px;border-radius:50%;text-align:center;font-size:12px;}
    .keY30{background:#999999;color:#FFF;width:35px;height:35px;line-height:35px;border-radius:50%;text-align:center;font-size:12px;}
    .keY40{background:#66b1ff;color:#FFF;width:35px;height:35px;line-height:35px;border-radius:50%;text-align:center;font-size:12px;}
    .keY50{background:#e6a23c;color:#FFF;width:35px;height:35px;line-height:35px;border-radius:50%;text-align:center;font-size:12px;}
    /* 假设你想恢复某个特定容器的默认滚动条样式 */
    /*#dituiuser ::-webkit-scrollbar {*/
    /*    margin-top:20px;*/
    /*    width: auto; !* 默认宽度 *!*/
    /*    height: auto; !* 默认高度 *!*/
    /*}*/
    /*#dituiuser ::-webkit-scrollbar-track {*/
    /*    background: transparent; !* 默认背景 *!*/
    /*}*/
    /*#dituiuser ::-webkit-scrollbar-thumb {*/
    /*    background: transparent; !* 默认拇指背景 *!*/
    /*}*/
    .upload-demo input{display:none;}
</style>
<div style="padding:20px;">
    <div id="dituiuser" v-cloak>
        <div style="background:#FFF;padding-top:20px;margin-bottom:10px;padding-left:10px;display:flex;">
            <div style="flex:1;">
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item style="width:150px;">
                        <el-select v-model="formInline.sellerId" filterable placeholder="选择地推专员">
                            <el-option key="0" label="手动添加的" value="0"></el-option>
                            <el-option
                                    v-for="item in sellerArr"
                                    :key="item.ds_userid"
                                    :label="item.ds_truename"
                                    :value="item.ds_userid">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="width:100px;">
                        <el-input v-model="formInline.name" placeholder="姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="" style="width:120px;">
                        <el-input v-model="formInline.school" placeholder="学校"></el-input>
                    </el-form-item>
                    <el-form-item label="" style="width:120px;">
                        <el-input v-model="formInline.phone" placeholder="手机号" maxlength="11"></el-input>
                    </el-form-item>
                    <el-form-item label="" style="width:120px;">
                        <el-input v-model="formInline.remark" placeholder="备注"></el-input>
                    </el-form-item>
                    <el-form-item label="" style="width:80px;">
                        <el-select v-model="formInline.sex" placeholder="性别">
                            <el-option label="未填写" value="0"></el-option>
                            <el-option label="男生" value="1"></el-option>
                            <el-option label="女生" value="2"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" style="width:120px;">
                        <el-input v-model="formInline.xuehao" placeholder="学号 / ID号"></el-input>
                    </el-form-item>
                    <el-form-item style="width:125px;">
                        <el-select v-model="formInline.flowint" filterable placeholder="选择班级/状态">
                            <el-option key="all" label="全 部" value="all" ></el-option>
                            <el-option key="0" label="未分班" value="0" ></el-option>
                            <el-option
                                    v-for="(item, index) in zhuanghuaArr"
                                    :key="String(index+1)"
                                    :label="item"
                                    :value="String(index+1)">
                            </el-option>
                            <el-option key="-1" label="退款中" value="-1" ></el-option>
                            <el-option key="-4" label="已退款" value="-4" ></el-option>
                            <el-option key="100" label="学业完成" value="100" ></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item>
                        <el-button type="primary" @click="search('yes')">查询</el-button>
                        <el-button @click="search('no')">全部</el-button>
                    </el-form-item>
                </el-form>
            </div>
            <div style="width:200px;text-align: right;padding-right:10px;">
                <div style="width:200px;text-align: right;padding-right:10px;">
<!--                    <div>-->
<!--                        <el-button type="danger" @click="openAddUserBox('add', '手动添加陌客')">手动添加陌客</el-button>-->
<!--                    </div>-->
                    <div style="padding-top:0px;">
                        <el-upload
                                class="upload-demo"
                                action="/index.php?s=/store/ditui.dtuserok/piliAddstudent"
                                :multiple="false"
                                :show-file-list="false"
                                accept=".csv"
                                :before-upload="beforeUpload"
                                :on-success="chooceFileOk"
                                :file-list="fileList">
                            <el-button size="small" type="primary">点击上传</el-button>
                        </el-upload>
                    </div>
                    <div style="padding-top:5px;font-size:13px;"><a href="/myscript/pldr_student.CSV" target="_blank">下载批量导入学员模板</a></div>
                </div>
            </div>
        </div>

        <div style="background:#FFF;padding-bottom:0;padding-top:20px;padding-left:10px;padding-right:10px;margin-bottom:5px;">
            <el-tabs id="tabBox" type="card" v-model="activeName" @tab-click="handleClick" :stretch="true">
                <el-tab-pane name="tab_all">
                    <span slot="label" :class="activeName=='tab_all' ? 'tabGB0' : ''"><i class="el-icon-user"></i>全部 ({{allBigNumArr['allNum_all']}})</span>
                </el-tab-pane>
                <el-tab-pane name="tab_0">
                    <span slot="label" :class="activeName=='tab_0' ? 'tabGB1' : ''"><i class="el-icon-error"></i>未分班
                    <span :style="activeName=='tab_0' ? 'tabGB1' : 'color:#FF0000;font-weight:bold;font-size:18px;'"> ({{allBigNumArr['allNum_0']}})</span></span>
                </el-tab-pane>
                <el-tab-pane :name="'tab_'+(index+1)" v-for="(item, index) in zhuanghuaArr">
                    <span slot="label" :class="activeName=='tab_'+(index+1) ? 'tabGB2' : ''"><i class="el-icon-user"></i>{{item}} ({{allBigNumArr['allNum_'+(index+1)]}})</span>
                </el-tab-pane>
                <el-tab-pane name="tab_-1">
                    <span slot="label" :class="activeName=='tab_-1' ? 'tabGBDel' : ''"><i class="el-icon-warning"></i>退费中 ({{allBigNumArr['allNum_-1']}})</span>
                </el-tab-pane>
                <el-tab-pane name="tab_-4">
                    <span slot="label" :class="activeName=='tab_-4' ? 'tabGBDel2' : ''"><i class="el-icon-remove"></i>已退费 ({{allBigNumArr['allNum_-4']}})</span>
                </el-tab-pane>
                <el-tab-pane name="tab_100">
                    <span slot="label" :class="activeName=='tab_100' ? 'tabGB3' : ''"><i class="el-icon-success"></i>结业完成 ({{allBigNumArr['allNum_100']}})</span>
                </el-tab-pane>
            </el-tabs>
        </div>

        <el-empty v-if="tableData.length==0" description="该班级无学生数据"></el-empty>
        <el-table v-else border stripe size="mini" ref="multipleTable" tooltip-effect="dark" :data="tableData" @selection-change="handleSelectionChange" style="width: 100%">
<!--            <el-table-column label="机构名称" >-->
<!--                <template slot-scope="scope">{{scope.row.dl_shopname}}</template>-->
<!--            </el-table-column>-->
            <el-table-column fixed="left" type="selection" width="45" header-align="center"></el-table-column>
<!--            <el-table-column label="头像" width="60" header-align="center">-->
<!--                <template slot-scope="scope">-->
<!--                    <div style="text-align:center;" @click="openModify('modify', '修改信息', scope.$index, scope.row)">-->
<!--                        <div><el-avatar size="large" :src="scope.row.avatarUrl"></el-avatar></div>-->
<!--                    </div>-->
<!--                </template>-->
<!--            </el-table-column>-->
            <el-table-column fixed="left" label="姓名" width="110" header-align="center">
                <template slot-scope="scope">
                    <div @click="openModify('modify', '修改信息', scope.$index, scope.row)" style="cursor:pointer;text-align:center;">
                        <span style="font-weight:bold;color:#000;font-size:15px;">{{scope.row.du_truename}}</span>
                        <!--<span>（{{scope.row.du_age}}岁）</span>-->
                        <el-badge style="margin-top:10px;" :value="getSexStr(scope.row.du_sex)" class="item" :type="getSexBtnType(scope.row.du_sex)">
                            <span>&nbsp;&nbsp;</span>
                        </el-badge>
                    </div>
                </template>
            </el-table-column>
            <el-table-column fixed="left" label="班级 / 消课" width="130" header-align="center">
                <template slot-scope="scope">
                    <div style="text-align:center;cursor:pointer;" @click="openFlowChange(scope.$index, scope.row)">
                        <div v-if="scope.row.ke_name!='未设置'"><span style="color:#409EFF;font-weight:bold;font-size:16px;"><span style="">消课：</span>{{scope.row.xiaoke_jd}}</span></div>
                        <div>
                            <span v-for="(item, index) in zhuanghuaArr">
                                <span v-if="scope.row.du_class==(index+1)"><el-tag type="danger" >{{item}} ▼</el-tag></span>
                            </span>
                            <span v-if="scope.row.du_class==-1"><el-tag type="info" style="color:#FFF;" color="#666">退款中</el-tag></span>
                            <span v-if="scope.row.du_class==-4"><el-tag type="info" style="color:#FFF;" color="#999">已退款</el-tag></span>
                            <span v-if="scope.row.du_class==100"><el-tag type="info" >已结业</el-tag></span>
                        </div>
                    </div>
                </template>
            </el-table-column>
            <el-table-column fixed="left" label="备注" header-align="center" width="50">
                <template slot-scope="scope">
                    <div style="display:flex;">
                        <div style="flex:1;cursor: pointer;text-align:center;" @click="openTheLogBox(scope.$index, scope.row)">
                            <span @click="openTheLogBox(scope.$index, scope.row)">
                                <el-button :style="getHeaderBg(scope.row.du_flowid, 2)" type="success" icon="el-icon-edit-outline" circle size="mini"></el-button>
                            </span>
                        </div>
                    </div>
                </template>
            </el-table-column>
            <el-table-column fixed="left" label="当前课程" width="80" header-align="center">
                <template slot-scope="scope">
                    <div style="cursor:pointer;text-align: center;" @click="xiaokeInit(scope.$index, scope.row)">
                        <div style="padding:0;line-height:15px;"><span style="color:#666;">{{scope.row.ke_name}}</span></div>
                    </div>
                </template>
            </el-table-column>

            <el-table-column label="电话 / 昵称" width="110" header-align="center">
                <template slot-scope="scope">
                    <div @click="xiaokeInit(scope.$index, scope.row)" style="cursor:pointer;">
                        <div>
                            <span style="color:#666;font-weight:bold;font-size:14px;">{{scope.row.du_mobile}}</span>
                        </div>
                        <div style="padding:0;line-height:20px;color:#999;text-align:center;" v-if="scope.row.nickName!='微信用户'">{{scope.row.nickName}}</div>
                    </div>
                </template>
            </el-table-column>
<!--            <el-table-column label="头像" width="60" header-align="center">-->
<!--                <template slot-scope="scope">-->
<!--                    <div @click="openModify('modify', '修改信息', scope.$index, scope.row)" style="text-align: center;cursor: pointer;">-->
<!--                        <el-avatar size="medium" :src="scope.row.avatarUrl"></el-avatar>-->
<!--                    </div>-->
<!--                </template>-->
<!--            </el-table-column>-->
            <el-table-column label="学校" width="130" header-align="center">
                <template slot-scope="scope">
                    <div style="padding:0;line-height:15px;cursor:pointer;text-align: center;">
                        <span @click="xiaokeInit(scope.$index, scope.row)">{{scope.row.du_school}}</span>
                    </div>
                </template>
            </el-table-column>
            <el-table-column label="年级" width="90" header-align="center">
                <template slot-scope="scope">
                    <div @click="xiaokeInit(scope.$index, scope.row)" style="cursor:pointer;text-align: center;">
                        <div style="padding:0;line-height:15px;"><span style="color:#666;">{{scope.row.du_grade}}</span></div>
<!--                        <div style="padding:0;line-height:20px;color:#999;" v-if="scope.row.points>0">积分：{{scope.row.points}}</div>-->
                    </div>
                </template>
            </el-table-column>
<!--            <el-table-column label="自定义备注">-->
<!--                <template slot-scope="scope">-->
<!--                    <div><el-input type="textarea" :rows="4" v-model="scope.row.du_zhmyremark" :readonly="true"></el-input></div>-->
<!--                </template>-->
<!--            </el-table-column>-->

            <el-table-column label="学习消课情况" header-align="left" :width="keTabWidth">
                <template slot-scope="scope">
                    <div>
<!--                        <div style="text-align: center" v-for="bigitem in scope.row.kearr">-->
                            <div style="display:flex;text-align: center">
                                <div style="flex:1;padding:2px;" v-for="(item, index) in scope.row.kearr">
                                    <div style="background:#eee;font-weight: bold;">{{item.k_dateStr}}</div>
                                    <div style="padding:2px;text-align: center;cursor:pointer;" @click="setXK(scope.row.ux_id, scope.row.kearr, index, scope.$index)">
                                        <div v-if="item.k_note==''" :class="'keY'+item.k_type" style="margin:0 auto;">{{item.k_typestr}}</div>
                                        <el-tooltip v-else class="item" effect="dark" :content="getTipTxt(item)" placement="bottom">
                                            <div :class="'keY'+item.k_type" style="margin:0 auto;">{{item.k_typestr}}</div>
                                        </el-tooltip>
                                    </div>
                                </div>
                            </div>
<!--                        </div>-->
                    </div>
                </template>
            </el-table-column>

<!--            <el-table-column label="学习消课情况" header-align="center">-->
<!--                <el-table-column label="1：（9.8）" width="120" header-align="center">-->
<!--                    <template slot-scope="scope">-->
<!--                        <div>aaaa</div>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column label="2：（9.9）" width="120" header-align="center">-->
<!--                    <template slot-scope="scope">-->
<!--                        <el-popover trigger="hover" placement="top">-->
<!--                            <p>姓名: {{ scope.row.du_grade }}</p>-->
<!--                            <p>住址: {{ scope.row.points }}</p>-->
<!--                            <div slot="reference" class="name-wrapper">-->
<!--                                <el-tag size="medium">{{ scope.row.du_truename }}</el-tag>-->
<!--                            </div>-->
<!--                        </el-popover>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--                <el-table-column label="3：（09.10）" width="120" header-align="center">-->
<!--                    <template slot-scope="scope">-->
<!--                        <div>cccc</div>-->
<!--                    </template>-->
<!--                </el-table-column>-->
<!--            </el-table-column>-->
        </el-table>

        <div style="background:#FFF;padding:20px 0;margin-top:0px;display: flex;">
            <div style="width:300px;padding-left:20px;">
                <el-button type="primary" size="mini" @click="pimoveInit">批量分班</el-button>
            </div>
            <div style="flex:1;text-align:right;">
                <el-pagination
                        background
                        layout="total, prev, pager, next"
                        :total="totalItems"
                        :page-size="pageSize"
                        @current-change="handleCurrentChange"
                        :current-page.sync="currentPage">
                </el-pagination>
            </div>
        </div>

        <el-dialog :title="modifyTitle" :visible.sync="addMokeDivShow" :close-on-click-modal="false" :close-on-press-escape="false" width="30%">
            <el-form :model="personObj" :rules="rules" ref="personObj" label-width="120px" class="demo-ruleForm">
                <el-form-item label="手机1：" prop="mmphone">
                    <div style="display:flex;">
                        <div style="flex:1;">
                            <div>
                                <el-input maxlength="11" v-model="personObj.mmphone" :disabled="userModifyKey=='add' ? false : true" placeholder="请输入陌客手机号" maxlength="11" autocomplete="off"></el-input>
                            </div>
                            <div style="display:flex;">
                                <div style="width:80px;color:#F00;font-weight:bold;" v-if="personObj.points>0">积分:{{personObj.points}}</div>
                                <div style="flex:1;text-align:right;" v-if="personObj.nickName!=null && personObj.nickName!=''">{{personObj.nickName}}</div>
                            </div>                        </div>
                        <div v-if="personObj.avatarUrl!=null && personObj.avatarUrl!=''" style="width:100px;text-align:right;">
                            <img :src="personObj.avatarUrl" style="width:80px;height:80px;border-radius:50%;" />
                        </div>
                    </div>
                </el-form-item>
                <el-form-item label="姓名：">
                    <el-input v-model="personObj.mokeName" placeholder="请输入姓名（可不填）" maxlength="12" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="手机2" prop="mmTwoPhone">
                    <el-input type="number" v-model="personObj.mmTwoPhone" maxlength="11"></el-input>
                </el-form-item>
                <el-form-item label="学校：">
                    <el-select v-model="personObj.school" placeholder="请选择学校（可不填）">
                        <el-option v-for="item in schoolArr" :key="item" :label="item" :value="item"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="年级：">
                    <el-select v-model="personObj.grade" placeholder="请选择年级（可不填）">
                        <el-option v-for="item in grade" :key="item.value" :label="item.label" :value="item.value"> </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="年龄：">
                    <el-input v-model="personObj.age" placeholder="请输入年龄（可不填）" maxlength="2" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="性别：">
                    <el-radio-group v-model="personObj.sex">
                        <el-radio border  :label="0">未知</el-radio>
                        <el-radio border  :label="1">男生</el-radio>
                        <el-radio border  :label="2">女生</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="地址：">
                    <el-input v-model="personObj.address" placeholder="请输入地址（可不填）" maxlength="30" autocomplete="off"></el-input>
                </el-form-item>
<!--                <el-form-item label="家属：">-->
<!--                    <el-input v-model="personObj.pname" placeholder="请输入家属姓名（可不填）" maxlength="12" autocomplete="off"></el-input>-->
<!--                </el-form-item>-->
                <el-form-item label="打分：">
                    <div style="padding-top:10px;">
                        <el-rate v-model="personObj.dafen" :max="5" show-score text-color="#ff9900" ></el-rate>
                    </div>
                </el-form-item>
                <el-form-item label="课本教材：" v-if="personObj.du_english!=''">
                    <div>{{personObj.du_english}}</div>
                </el-form-item>
                <el-form-item label="学习期望：" v-if="personObj.du_hopestr!=''">
                    <div>{{personObj.du_hopestr}}</div>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="addMokeDivShow = false">取 消</el-button>
                <el-button :disabled="butajaxing" type="primary" @click="addMoke()">确 定</el-button>
            </div>
        </el-dialog>

        <el-dialog title="添加备注" :visible.sync="remarkBoxShow" :close-on-click-modal="false" :close-on-press-escape="false" width="50%">
            <el-form ref="bbb">
                <el-input type="textarea" :rows="10" v-model="remarkTxt" placeholder="请输入备注" autocomplete="off"></el-input>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="remarkBoxShow = false">取 消</el-button>
                <el-button :disabled="butajaxing" type="primary" @click="runBeizhu">确 定</el-button>
            </div>
        </el-dialog>

        <el-dialog title="添加备注日志" :visible.sync="theLogBoxShow" :close-on-click-modal="false" :close-on-press-escape="false" width="70%">
            <div>
                <el-table border ref="multipleTable" tooltip-effect="dark" :data="nowROWARR" style="width: 100%">
                    <el-table-column label="进线日期" header-align="center">
                        <template slot-scope="scope">
                            <div style="text-align: center;">
                                <span style="color:#f3f;font-weight:bold;font-size:20px;" v-html="getShortTime(scope.row.dl_addtime,1)">{{scope.row.dl_addtime}}</span>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="姓名" header-align="center">
                        <template slot-scope="scope">
                            <div style="text-align: center;">
                                <el-badge style="margin-top:10px;" :value="getSexStr(scope.row.du_sex)" class="item" :type="getSexBtnType(scope.row.du_sex)">
                                    <div>
                                        <span style="font-weight:bold;color:#000;font-size:16px;">{{scope.row.du_truename}}</span>
                                    </div>
                                </el-badge>
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column label="电话" header-align="center">
                        <template slot-scope="scope"><div style="text-align: center;"><span style="color:#666;font-weight:bold;">{{scope.row.du_mobile}}</span></div></template>
                    </el-table-column>
                    <el-table-column label="学校" header-align="center">
                        <template slot-scope="scope"><div style="text-align: center;"><span>{{scope.row.du_school}}</span></div></template>
                    </el-table-column>
                    <el-table-column label="年级" header-align="center">
                        <template slot-scope="scope"><div style="text-align: center;"><span>{{scope.row.du_grade}}</span></div></template>
                    </el-table-column>
                </el-table>
            </div>

            <div style="padding-top:10px;">
                <el-form ref="ccc" :inline="true" :model="logFormObj" class="demo-form-inline">
                    <div style="display: flex">
                        <div style="width:120px;">
                            <el-form-item label="" >
                                <el-input v-model="logFormObj.inName" :disabled="true" placeholder="管理员姓名"></el-input>
                            </el-form-item>
                        </div>
                        <div style="width:140px;">
                            <el-form-item label="">
                                <el-select v-model="logFormObj.opmstr">
                                    <el-option label="电话沟通" value="电话沟通"></el-option>
                                    <el-option label="地推面聊" value="地推面聊"></el-option>
                                    <el-option label="微信沟通" value="微信沟通"></el-option>
                                    <el-option label="自定义备注" value="自定义备注"></el-option>
                                    <el-option label="面对面沟通" value="面对面沟通"></el-option>
                                    <el-option label="交定金沟通" value="交定金沟通"></el-option>
                                    <el-option label="退费沟通" value="退费沟通"></el-option>
                                </el-select>
                            </el-form-item>
                        </div>
                        <div style="flex:1;padding-right:10px;" id="beizhu">
                            <el-form-item label="" style="width:100%;">
                                <el-input style="width:100%;"  v-model="logFormObj.logtxt" placeholder="填写本次沟通备注"></el-input>
                            </el-form-item>
                        </div>
                        <div style="width:120px;">
                            <el-form-item label="">
                                <el-button :disabled="butajaxing" style="background:#F00;color:#FFF;" type="primary" @click="runAddLog">添加日志</el-button>
                            </el-form-item>
                        </div>
                    </div>
                </el-form>
            </div>

            <div style="padding-top:10px;font-size:16px;">
                <div v-for="(item, index) in nowZhmarkArr" style="display:flex;">
                    <div style="flex-basis: auto;">
                        <span>{{item.no}}：</span>
                    </div>
                    <div style="flex-basis: auto;">{{item.cl_adminname}}</div>
                    <div style="flex-basis: auto;color:#00F;">【{{item.cl_typestr}}】</div>
                    <div style="flex:1;">{{item.cl_logtxt}}</div>
                    <div style="flex-basis: auto;text-align:right;font-weight:bold;" v-html="getShortTime(item.cl_addtime,2)"></div>
                </div>
            </div>
<!--            <div slot="footer" class="dialog-footer">-->
<!--                <el-button @click="theLogBoxShow = false">取 消</el-button>-->
<!--                <el-button :disabled="butajaxing" type="primary" @click="runAddLog">添加日志</el-button>-->
<!--            </div>-->
        </el-dialog>

        <el-dialog title="设置学员分班" :visible.sync="flowBoxShow" :close-on-click-modal="false" :close-on-press-escape="false" width="60%">
            <div>
                <div style="color:#F00;">确定对以下学员进行分班：</div>
                <div style="padding:20px;display: flex; flex-wrap: wrap;justify-content: flex-start;">
                    <div style="padding-right:10px;padding-bottom:10px;" v-for="item in trueNameArr">
                        <div><el-tag type="success">{{item}}</el-tag></div>
                    </div>
                </div>
            </div>
            <el-form>
                <el-radio-group v-model="nowFlowInt">
                    <el-radio border v-for="(item, index) in zhuanghuaArr"  :label="index+1">分班到->{{item}}</el-radio>
<!--                    <el-radio border  :label="1">分班到->第1班</el-radio>-->
<!--                    <el-radio border  :label="2">分班到->第2班</el-radio>-->
<!--                    <el-radio border  :label="3">分班到->第3班</el-radio>-->
<!--                    <el-radio border  :label="4">分班到->第4班</el-radio>-->
<!--                    <el-radio border  :label="5">分班到->第5班</el-radio>-->
<!--                    <el-radio border  :label="6">分班到->第6班</el-radio>-->
<!--                    <el-radio border  :label="7">分班到->第7班</el-radio>-->
<!--                    <el-radio border  :label="8">分班到->第8班</el-radio>-->
                    <el-radio border  :label="-1">设置退费中</el-radio>
                    <el-radio border  :label="-4">设置已退费</el-radio>
                    <el-radio border  :label="100">设置结业完成</el-radio>
                </el-radio-group>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="flowBoxShow = false">取 消</el-button>
                <el-button :disabled="butajaxing" type="primary" @click="runSetMoveOrBackCall('move')">确定分班</el-button>
            </div>
        </el-dialog>

        <el-dialog title="设置消课情况" :visible.sync="xiaokeDivShow" :close-on-click-modal="false" :close-on-press-escape="false" width="90%">
            <div>
                <div style="display: flex;">
                    <div v-if="nowRow!=null" style="display: flex;padding-top:3px;">
                        <div style="text-align:center;">
                            <span style="font-weight:bold;color:#000;font-size:15px;">{{nowRow.du_truename}}</span>
                            <el-badge style="margin-top:10px;" :value="getSexStr(nowRow.du_sex)" class="item" :type="getSexBtnType(nowRow.du_sex)">
                                <span>&nbsp;&nbsp;</span>
                            </el-badge>
                        </div>
                        <div style="padding-left:30px;">
                            <span v-for="(item, index) in zhuanghuaArr">
                                <span v-if="nowRow.du_class==(index+1)"><el-tag type="danger" >{{item}}</el-tag></span>
                            </span>
                        </div>
                    </div>
                    <div style="padding-left:30px;">
                        <el-select v-model="nowKeId" filterable placeholder="选择要给该学员添加的课程">
                            <el-option key="0" label="选择要添加的课程" value="0" ></el-option>
                            <el-option
                                    v-for="(item, index) in keArr"
                                    :key="String(index+1)"
                                    :label="getKeStr(item)"
                                    :value="String(index+1)">
                            </el-option>
                        </el-select>
                    </div>
                    <div style="padding-left:20px;"><el-button type="primary" @click="addKe('add')">给学员添加课程</el-button></div>
                    <div style="padding-left:20px;"><el-button type="danger" @click="addKe('del')">删除课程</el-button></div>
                </div>
                <div style="padding-top:20px;">
                    <el-collapse v-model="activeNamesZD" accordion>
                        <el-collapse-item v-for="(item, index) in nowPerSonKeArr" :title="item.keName" :name="index+1">
                            <div>
                                <div style="display:flex;text-align: center;flex-wrap:wrap;">
                                    <div style="width:70px;padding:2px;" v-for="(item2, index2) in item.ux_xiaoke_arr">
                                        <div style="background:#eee;font-weight: bold;">{{item2.k_dateStr}}</div>
                                        <div style="padding:2px;text-align: center;">
                                            <div :class="'keY'+item2.k_type" style="margin:0 auto;">{{item2.k_typestr}}</div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </el-collapse-item>
                    </el-collapse>
                </div>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button @click="xiaokeDivShow = false">取 消</el-button>
            </div>
        </el-dialog>
        <el-dialog title="为该学员设置消课" :visible.sync="setXkDivShow" :close-on-click-modal="false" :close-on-press-escape="false" width="60%" @close="setXkQX">
            <div>
                <div>
                    <el-form ref="ddd" :inline="true" :model="setObj" class="demo-form-inline">
                        <div>
                            <div v-if="nowRow!=null" style="display: flex;padding-top:3px;padding-bottom:20px;">
                                <div style="text-align:center;">
                                    <span style="font-weight:bold;color:#000;font-size:15px;">{{nowRow.du_truename}}</span>
                                    <el-badge style="margin-top:10px;" :value="getSexStr(nowRow.du_sex)" class="item" :type="getSexBtnType(nowRow.du_sex)">
                                        <span>&nbsp;&nbsp;</span>
                                    </el-badge>
                                </div>
                                <div style="padding-left:30px;">
                                    <span v-for="(item, index) in zhuanghuaArr">
                                        <span v-if="nowRow.du_class==(index+1)"><el-tag type="danger" >{{item}}</el-tag></span>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div>
                            <el-form-item label="消课日期：">
                                <el-date-picker style="width:150px;"
                                    v-model="setObj.k_dateStr"
                                    type="date"
                                    placeholder="选择消课日期"
                                    format="MM月dd"
                                    value-format="MM月dd">
                                </el-date-picker>
                            </el-form-item>
                            <el-form-item label="">
                                <el-select v-model="setObj.k_type" style="width:150px;">
                                    <el-option label="选择消课类型" value="0"></el-option>
                                    <el-option label="正常消课" value="10"></el-option>
                                    <el-option label="缺课" value="20"></el-option>
                                    <el-option label="请假" value="30"></el-option>
                                    <el-option label="补课" value="40"></el-option>
                                    <el-option label="自定义消课" value="50"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="">
                                <el-select v-model="setObj.k_use" style="width:150px;">
                                    <el-option label="本次消耗课时" value="0"></el-option>

                                    <el-option v-for="(item, index) in [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]"
                                               :label="'x '+(index+1)+' 课时'" :value="String(index+1)"></el-option>
                                </el-select>
                            </el-form-item>
                            <el-form-item label="补哪天的课：" v-if="setObj.k_type=='40'">
                                <el-date-picker style="width:180px;"
                                    v-model="setObj.k_bukeDate"
                                    type="date"
                                    placeholder="选择补哪天的课"
                                    format="MM月dd"
                                    value-format="MM月dd">
                                </el-date-picker>
                            </el-form-item>
                        </div>
                        <div>
                            <el-form-item label="消课备注：">
                                <el-input v-model="setObj.k_note" placeholder="选填消课备注" autocomplete="off" style="width:600px;"></el-input>
                            </el-form-item>
                        </div>
                    </el-form>
                </div>
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button :disabled="butajaxing" type="primary" @click="runSetXiaoKe">确定消课</el-button>
                <el-button @click="setXkDivShow = false">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</div>

<script>
    const validatePhone = (rule, value, callback) => {
        // 手机号码正则表达式
        const reg = /^1[3-9]\d{9}$/;
        if (reg.test(value)) {
            // 如果符合规则，则通过验证
            callback();
        } else {
            // 否则返回错误信息
            callback(new Error('手机号格式不正确'));
        }
    }
    var _theData = <?php echo json_encode($data); ?>;
    var _this = null;
    // var flowArr = ['all',0,1,2,3,4,5,6,7,8,100];
    var flowArr = _theData.flowArr;
    console.log(_theData);
    //alert(BASE_URL+"***"+STORE_URL);
    var fullLoading = null;
    new Vue({
        el: '#dituiuser',
        data: {
            fileList:[], //批量上传数据
            activeNamesZD: '1', //折叠面板
            nowPerSonKeArr: [],
            keArrDD:null,

            keTabWidth:_theData.keTabWidth,
            tabelYS:'one',
            theLogBoxShow:false,
            xiaokeDivShow:false,
            setXkDivShow:false,
            ux_id:-1,
            yuanIndex:-1,
            setObj:{
                k_bukeDate:'',
                k_dateStr:'',
                k_type:'0',
                k_use:'0',
                k_typestr:'',   //X3
                k_note:'',
                addtime:''
            },
            logFormObj:{
              inName:_theData.adminName,
              opmstr:'电话沟通',
              logtxt:'',
            },
            nowZhmarkArr:[],
            nowROWARR:[],

            grade: [{ value: '无', label: '无' },{ value: '一年级', label: '一年级' },{ value: '二年级', label: '二年级' },{ value: '三年级', label: '三年级' },
                { value: '四年级', label: '四年级' },{ value: '五年级', label: '五年级' },{ value: '六年级', label: '六年级' },
                { value: '幼儿园小班', label: '幼儿园小班' },{ value: '幼儿园中班', label: '幼儿园中班' },{ value: '幼儿园大班', label: '幼儿园大班' },
                { value: '七年级', label: '七年级' },{ value: '八年级', label: '八年级' },{ value: '九年级', label: '九年级' },{ value: '其他', label: '其他' }],

            opmDlidArr:[],
            moveMobileArr:[],
            trueNameArr:[],
            flowBoxShow:false,
            nowFlowInt:0,

            zhuanghuaArr: _theData.zhuanghuaArr,    //字典的数组
            sellerArr: _theData.sellerArr, //所有地推员数据
            schoolArr: _theData.schoolArr, //学校字符串数组
            allBigNumArr:_theData.allBigNumArr, //每个阶段的总个数
            keArr:_theData.keArr,   //课程字典列表

            backCallBoxShow:false,
            backCallNextTime:"",

            activeName: 'tab_all',
            multipleSelection: [],  //多选框
            butajaxing:false,
            modifyTitle: '手动添加陌客',
            userModifyKey: 'add',
            // 添加和修改客户的时候使用
            personObj:{
                mmphone:"",
                mmTwoPhone:"",
                du_english:"",
                du_hopestr:"",
                mokeName: "",
                sex:0,
                age:"", //年龄
                pname:"",   //家属姓名
                address:"", //地址
                school:"",
                grade:"",
                dafen:0, //数据得分
            },
            rules: {
                //<el-form-item label="手机：" prop="mmphone">，不加这个是不会成功的
                mmphone: [
                    { required: true, message: '请输入手机', trigger: 'blur' },
                    { validator: validatePhone, trigger: 'blur' },
                ],
                mmTwoPhone: [
                    { validator: validatePhone, trigger: 'blur' },
                ]
            },
            // 搜索相关的字段
            formInline: {
                startTime: '',
                endTime: '',
                day_str:'',
                phone: '',
                school:'',
                remark: '',
                name:'',
                flowint:'',
                xuehao:'',
                sellerId:'',
                sex:'',
            },
            addMokeDivShow:false,
            remarkBoxShow:false,
            remarkTxt:'',
            nowdl_id:0,
            nowRowCnt:0,
            nowRow:null,
            nowKeId:'0', //当前下拉选择的哪个课程将要添加给学员

            tableData: _theData.list,
            currentPage: 1,
            pageSize: SIZE30,     //PAGESIZE
            callBackNum: _theData.callBackNum,
            totalItems: _theData.allNum // 假设总共有100条记录
        },
        watch: {
            'formInline.flowint': function(newVal, oldVal) {
                console.log(newVal, oldVal);
                if (typeof newVal === 'number') {
                    this.formInline.flowint = newVal.toString();
                }
            },
            'setObj.k_use':function(newVal, oldVal){
                this.k_use = newVal.toString();
                if(this.setObj.k_type=='10'){
                    this.setObj.k_typestr = "消X"+newVal;
                }
                if(this.setObj.k_type=='20'){
                    this.setObj.k_typestr = "缺X"+newVal;
                }
                if(this.setObj.k_type=='30'){
                    this.setObj.k_typestr = "假X"+newVal;
                }
                if(this.setObj.k_type=='40'){
                    this.setObj.k_typestr = "补X"+newVal;
                    this.setObj.k_note=='' ? this.setObj.k_note = "备注：" : '';
                }
                if(this.setObj.k_type=='50'){
                    this.setObj.k_typestr = "X"+newVal;
                    this.setObj.k_note=='' ? this.setObj.k_note = "备注：" : '';
                }
            }
        },
        mounted(){
            _this = this;
        },
        methods: {
            clearSetObj(){
                this.setObj = {
                    k_bukeDate:'',
                    k_dateStr:'',
                    k_type:'0',
                    k_use:'0',
                    k_typestr:'',   //X3
                    k_note:'',
                    addtime:''
                }
            },
            getTipTxt(item){
                if(item.k_type=='40'){
                    return item.k_note+'【补'+item.k_bukeDate+'的课】';
                }
                else{
                    return item.k_note
                }
            },
            getKeStr(str){
                var strArr = str.split("#");
                return strArr[0];
            },
            //打开大型增加课程，设置消课面板
            xiaokeInit(index, row){
                this.clearSetObj();
                this.nowdl_id = row.dl_id;
                this.nowRowCnt = index;
                this.nowRow = row;
                this.nowKeId = '0';
                this.xiaokeDivShow=true;
                //请求该用户的课程列表
                this.nowPerSonKeArr = [];
                $.post('/index.php?s=/store/ditui.Xiaoke/getPerXK', {"dl_id":this.nowdl_id}, function (_res) {
                    _this.nowPerSonKeArr = _res.data.list;
                })
            },
            //打开小型的设置消课面板
            setXK(ux_id, keArr, yuanIndex, tableDataIndex){
                if(keArr[yuanIndex]['k_dateStr']==''){
                    this.xiaokeInit(tableDataIndex, this.tableData[tableDataIndex]);
                }
                else{
                    this.clearSetObj();
                    this.ux_id = ux_id;
                    this.keArrDD = keArr;
                    this.yuanIndex = yuanIndex;
                    this.nowRowCnt = tableDataIndex;
                    this.nowRow = this.tableData[tableDataIndex];
                    this.setXkDivShow = true;
                    //setObj = array('k_dateStr'=>'日 期', 'k_bukeDate'=>'', 'k_type'=>0, 'k_use'=>0, 'k_typestr'=>'', 'k_note'=>'', 'addtime'=>'');
                    keArr[yuanIndex]['k_dateStr']=='日 期' ? keArr[yuanIndex]['k_dateStr']='' : "";   //补课时间也要做此处理
                    this.setObj = keArr[yuanIndex];
                }
            },
            //取消小型的设置消课面板
            setXkQX(){
                var keArr = this.keArrDD;
                if(keArr != null){
                    var yuanIndex = this.yuanIndex;
                    if(keArr[yuanIndex]['k_dateStr']==''){
                        keArr[yuanIndex]['k_dateStr']='日 期';
                        this.setObj = keArr[yuanIndex];
                    }
                }
            },
            runSetXiaoKe(){
                $.post('/index.php?s=/store/ditui.Xiaoke/runSetXK', {"ux_id":this.ux_id, "yuanIndex":this.yuanIndex, "setObj":this.setObj}, function (_res) {
                    _this.setXkDivShow = false;
                    if(_res.code==0){
                        _this.$message.error(_res.msg);
                    }
                    else{
                        var perTableData = _this.tableData[_this.nowRowCnt];
                        perTableData['kearr'][_this.yuanIndex] = _this.setObj;
                        perTableData['xiaoke_jd'] = _res.data.xiaoke_jd;
                        _this.$set(_this.tableData, _this.nowRowCnt, perTableData);
                    }
                })
            },
            submitForm(formName) {
                var _this = this;
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        var jsonStr = JSON.stringify(_this.personObj)
                        console.log(_this.personObj, jsonStr);
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            getHeaderBg(flowId, type){
                if(type==1){
                    if(flowId==-1){
                        return 'background:#666666 !important;';
                    }
                    else if(flowId==0){
                        return 'background:#e6a23c !important;';
                    }
                    else if(flowId==80){
                        return 'background:#FF0000 !important;';
                    }
                    else{
                        return 'background:'+this.zhColorArr[flowId-1]+' !important;';
                    }
                }
                if(type==2){
                    if(flowId==-1){
                        return 'border:1px solid #666666 !important;background:#FFF !important;color:#666666 !important;';
                    }
                    else if(flowId==0){
                        return 'border:1px solid #e6a23c !important;background:#FFF !important;color:#e6a23c !important;';
                    }
                    else if(flowId==80){
                        return 'border:1px solid #FF0000 !important;background:#FFF !important;color:#FF0000 !important;';
                    }
                    else{
                        return 'border:1px solid '+this.zhColorArr[flowId-1]+' !important;background:#FFF !important;color:'+this.zhColorArr[flowId-1]+' !important;';
                    }
                }
            },
            getSexStr(sex){
                if(sex==1){
                    return '男';
                }
                else if(sex==2){
                    return '女';
                }
                else{
                    return '';
                }
            },
            getShortTime(timeStr, type){
              var arr1 = timeStr.split(' ');
              var arr2 = arr1[0].split('-');
              var arr3 = arr1[1].split(':');
              var one = arr2[1]+'-'+arr2[2];
              var two = arr3[0]+':'+arr3[1];
              if(type==1){
                  return one;
              }
              else{
                  return one+' '+two;
              }
            },
            getSexBtnType(sex){
                if(sex==1){
                    return 'primary';
                }
                else if(sex==2){
                    return 'danger';
                }
                else{
                    return 'info';
                }
            },
            // 选择或取消全选
            toggleSelection(rows) {
                if (rows) {
                    rows.forEach(row => {
                        this.$refs.multipleTable.toggleRowSelection(row);
                    });
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
            },
            // 点击每个勾选框之后
            handleSelectionChange(val) {
                this.multipleSelection = val;
                var chooseArr = this.multipleSelection;
                this.opmDlidArr = [];
                this.moveMobileArr = [];
                this.trueNameArr = [];
                for(var i=0,cnt=chooseArr.length; i<cnt; i++){
                    this.opmDlidArr.push(chooseArr[i]['dl_id']);
                    this.moveMobileArr.push(chooseArr[i]['du_mobile']);
                    this.trueNameArr.push(chooseArr[i]['du_truename']);
                }
                console.log('当前选择。', chooseArr, this.opmDlidArr);
            },
            handleClick(aa) {
                this.formInline.flowint = flowArr[aa.index];
                this.search('yes');
                //console.log(aa.index);
            },
            //打开沟通日志框
            openTheLogBox(index, row){
                this.nowROWARR = [row];
                this.logFormObj.logtxt = "";
                this.nowdl_id = row.dl_id;
                this.nowRowCnt = index;
                this.opmDlidArr = [row.dl_id];
                this.moveMobileArr = [row.du_mobile];
                this.trueNameArr = [row.du_truename];
                this.nowZhmarkArr = row.zhmarkArr;
                this.theLogBoxShow = true;
            },
            //打开备注框
            onFocusBZ(index, row){
                this.remarkTxt = row.du_zhmyremark;
                this.nowdl_id = row.dl_id;
                this.nowRowCnt = index;
            },
            onBlurBZ(index, row){
                this.remarkTxt = row.du_zhmyremark;
                this.nowdl_id = row.dl_id;
                this.nowRowCnt = index;
                this.runBeizhu();
            },
            // 打开状态设置框
            openFlowChange(index, row){
                // if(row.du_class==100){
                //     this.$message.error('已结业的学员不能再分班');
                // }
                // else {
                    this.nowdl_id = row.dl_id;
                    this.nowRowCnt = index;
                    this.opmDlidArr = [row.dl_id];
                    this.moveMobileArr = [row.du_mobile];
                    this.trueNameArr = [row.du_truename];
                    this.nowFlowInt = row.du_class;
                    this.flowBoxShow = true;
                // }
            },
            // 批量设置下次回访时间
            pibackCall(){
                var opmDlidArr = this.opmDlidArr;
                if(opmDlidArr.length==0){
                    this.$message.error('请选择要操作得数据');
                    _this.butajaxing = false;
                    return false;
                }
                this.backCallNextTime = "";
                this.nowRowCnt = 0;
                this.nowdl_id = 0;
                this.backCallBoxShow = true;
            },
            // 批量移动的初始化
            pimoveInit(){
                var opmDlidArr = this.opmDlidArr;
                if(opmDlidArr.length==0){
                    this.$message.error('请选择要分班的学员');
                    _this.butajaxing = false;
                    return false;
                }
                var dataArr = this.tableData;
                for(var i=0,cnt=opmDlidArr.length; i<cnt; i++){
                    var dlID = opmDlidArr[i];
                    for(var j=0,jcnt=dataArr.length; j<jcnt; j++){
                        if(dataArr[j]['dl_id'] == dlID){
                            if(dataArr[j]['du_class']== 100 || dataArr[j]['du_class']== -1 || dataArr[j]['du_class']== -4){
                                this.$message.error('退款中、已退款、已结业的数据不能分班');
                                _this.butajaxing = false;
                                return false;
                                break;
                            }
                        }
                    }
                }
                this.nowFlowInt = 0;
                this.nowRowCnt = 0;
                this.nowdl_id = 0;
                this.flowBoxShow = true;
            },
            // 打开修改框框
            openModify(key, title, index, row){
                this.userModifyKey = key;
                this.modifyTitle = title;
                this.remarkTxt = row.du_zhmyremark;
                this.nowdl_id = row.dl_id;
                this.nowRowCnt = index;
                this.personObj = {
                    mmphone:row.du_mobile,
                    avatarUrl:row.avatarUrl,
                    nickName:row.nickName,
                    points:row.points,
                    mmTwoPhone:row.du_mobile2,
                    du_english:row.du_english,
                    du_hopestr:row.du_hopestr,
                    mokeName: row.du_truename,
                    sex: row.du_sex,
                    age: row.du_age, //年龄
                    pname: row.du_ptruename,   //家属姓名
                    address: row.du_address, //地址
                    school: row.du_school,
                    grade: row.du_grade,
                    dafen: row.dl_dafen, //数据得分
                };
                this.addMokeDivShow = true;
            },
            handleEdit(index, row){
                this.remarkTxt = row.du_zhmyremark;
                this.nowdl_id = row.dl_id;
                this.nowRowCnt = index;
                this.remarkBoxShow = true;
            },
            runSetMoveOrBackCall(opmStr){
                this.butajaxing = true;
                var opmDlidArr = this.opmDlidArr;
                if(opmDlidArr.length==0){
                    this.$message.error('请选择要操作得数据');
                    _this.butajaxing = false;
                    return false;
                }
                if(opmStr=='backcall' && this.backCallNextTime==""){
                    this.$message.error('请选择下次回访的时间');
                    _this.butajaxing = false;
                    return false;
                }

                // 设置移动，需要输入移动密码
                if(opmStr=='move'){
                    var pwd = this.nowFlowInt==100 ? /123888/ : /123456/;
                    this.$prompt("请输入操作密码", "确定操作该数据？", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        inputPattern: pwd,
                        type: "warning",
                        inputErrorMessage: "口令错误",
                    })
                        .then(() => {
                            _this.ajaxopmMoveAndCallBack(opmStr);
                        })
                        .catch(() => {_this.butajaxing = false;});
                }
                // 设置回访不需要设置回访操作密码
                else{
                    this.ajaxopmMoveAndCallBack(opmStr)
                }

            },
            //移动，学生分配各个班级
            ajaxopmMoveAndCallBack(opmStr){
                $.post('/index.php?s=/store/ditui.Dtuserok/setClass', {"opmStr":opmStr, "opmDlidArr":this.opmDlidArr, nowFlowInt:this.nowFlowInt, "backCallNextTime":this.backCallNextTime}, function (_res) {
                    console.log('aaaaa', _res, _res.code)
                    _this.butajaxing = false;
                    _this.flowBoxShow = false;
                    _this.backCallBoxShow = false;
                    if(_res.code==0){
                        _this.$message.error(_res.msg);
                    }
                    else{
                        _this.$message({ message: _res.data.msg, type: 'success' });
                        // 单独点击设置回访按钮，渲染数据不刷新
                        if(_this.nowdl_id>0){
                            if(opmStr=='move'){
                                _this.tableData[_this.nowRowCnt]['du_class'] = _this.nowFlowInt;
                                _this.$set(_this.tableData, _this.nowRowCnt, _this.tableData[_this.nowRowCnt]);
                            }
                        }
                        else{
                            window.location = window.location;
                        }
                        //_this.search('no');
                    }
                })
            },
            //设置学员备注，调用其他控制器方法的方法
            runBeizhu(){
                var newBz = $.trim(this.remarkTxt);
                if(newBz==""){
                    this.$message.error('备注不能为空，至少保留一句备注');
                }
                else{
                    this.butajaxing = true;
                    $.post('/index.php?s=/store/ditui.Dtzhuanhua/addRemark', {"nowdl_id":this.nowdl_id, "nowdl_id":this.nowdl_id, "remarkTxt": newBz}, function (_res) {
                        console.log('aaaaa', _res, _res.code)
                        _this.butajaxing = false;
                        if(_res.code==0){
                            _this.$message.error(_res.msg);
                        }
                        else{
                            _this.$message({ message: _res.data.msg, type: 'success' });
                            _this.remarkBoxShow = false
                            _this.tableData[_this.nowRowCnt]['du_zhmyremark'] = newBz;
                            _this.$set(_this.tableData, _this.nowRowCnt, _this.tableData[_this.nowRowCnt]);
                        }
                    })
                }
            },
            runAddLog(){
                var logtxt = $.trim(this.logFormObj.logtxt);
                if(logtxt==""){
                    this.$message.error('日志备注不能为空，至少保留一句备注');
                }
                else {
                    this.butajaxing = true;
                    $.post('/index.php?s=/store/ditui.Dtzhuanhua/addcalllog', {"nowdl_id":this.nowdl_id, "logFormObj":this.logFormObj}, function (_res) {
                        console.log('aaaaa', _res, _res.code)
                        _this.butajaxing = false;
                        if(_res.code==0){
                            _this.$message.error(_res.msg);
                        }
                        else{
                            _this.$message({ message: _res.data.msg, type: 'success' });
                            _this.theLogBoxShow = false
                            _this.tableData[_this.nowRowCnt]['zhmarkArr'] = _res.data.newLogListArr;
                            _this.$set(_this.tableData, _this.nowRowCnt, _this.tableData[_this.nowRowCnt]);
                        }
                    })
                }
            },
            addMoke(){
                var _this = this;
                var _mmphone = $.trim(this.personObj.mmphone);
                var _mokeName = $.trim(this.personObj.mokeName);
                if(_mmphone==''){
                    //this.$alert('请输入地推员ID号');
                    this.$message.error('请输入陌客手机号');
                }
                else{
                    const phoneRegex = /^1[3-9]\d{9}$/;
                    if(!(phoneRegex.test(_mmphone))){
                        this.$message.error('手机号码错误');
                    }
                    else{
                        this.butajaxing = true;
                        $.post('/index.php?s=/store/ditui.Dtzhuanhua/addmoke', {"key":this.userModifyKey, "nowdl_id":this.nowdl_id, "personObj":this.personObj}, function (_res) {
                            console.log('aaaaa', _res, _res.code)
                            _this.butajaxing = false;
                            if(_res.code==0){
                                _this.$message.error(_res.msg);
                            }
                            else{
                                _this.$message({
                                    message: _res.data.msg,
                                    type: 'success'
                                });
                                // 如果是手动添加，则直接刷新页面
                                if(_this.userModifyKey=='add'){
                                    window.location = window.location;
                                }
                                // 如果是修改，则重新渲染数据，重新获取地推人员列表，换成跟新表
                                else{
                                    _this.tableData[_this.nowRowCnt]['du_mobile'] = _this.personObj.mmphone;
                                    _this.tableData[_this.nowRowCnt]['du_mobile2'] = _this.personObj.mmTwoPhone;
                                    _this.tableData[_this.nowRowCnt]['du_english'] = _this.personObj.du_english;
                                    _this.tableData[_this.nowRowCnt]['du_hopestr'] = _this.personObj.du_hopestr;
                                    _this.tableData[_this.nowRowCnt]['du_truename'] = _this.personObj.mokeName;
                                    _this.tableData[_this.nowRowCnt]['du_sex'] = _this.personObj.sex;
                                    _this.tableData[_this.nowRowCnt]['du_age'] = _this.personObj.age;
                                    _this.tableData[_this.nowRowCnt]['du_ptruename'] = _this.personObj.pname;
                                    _this.tableData[_this.nowRowCnt]['du_address'] = _this.personObj.address;
                                    _this.tableData[_this.nowRowCnt]['du_school'] = _this.personObj.school;
                                    _this.tableData[_this.nowRowCnt]['du_grade'] = _this.personObj.grade;
                                    _this.tableData[_this.nowRowCnt]['dl_dafen'] = _this.personObj.dafen;
                                    _this.$set(_this.tableData, _this.nowRowCnt, _this.tableData[_this.nowRowCnt]);
                                }
                                //清空input框
                                _this.clearAddInput();
                                _this.addMokeDivShow = false;
                            }
                        })
                    }
                }
            },
            clearAddInput(){
                this.personObj = {
                    mmphone:"",
                    mmTwoPhone:"",
                    du_english:"",
                    du_hopestr:"",
                    mokeName: "",
                    sex:0,
                    age:"",
                    pname:"",
                    address:"",
                    school:"",
                    grade:"",
                    dafen:0,
                };
            },
            search(key) {
                // 这里应该添加逻辑来过滤数据
                // console.log('搜索:', this.formInline);
                if(key=="no"){
                    this.formInline = {
                        activeName: 'tab_all',
                        startTime: '',
                        endTime: '',
                        day_str: key=="no" ? '' : key,
                        phone: '',
                        school:'',
                        remark: '',
                        name:'',
                        flowint:'',
                        xuehao:'',
                        sellerId:'',
                        sex:''
                    };
                }
                //点击搜索按钮，格式化table样式 开始------------------------------
                this.activeName = 'tab_'+this.formInline.flowint;
                this.formInline.activeName = 'tab_'+this.formInline.flowint;
                console.log(this.formInline.flowint);
                if(this.formInline.flowint === ''){
                    this.activeName = 'tab_all';
                    this.formInline.activeName = 'tab_all';
                }
                //点击搜索按钮，格式化table样式 结束------------------------------
                this.currentPage = 1;
                this.loadTableData();
            },
            handleCurrentChange(val) {
                this.currentPage = val;
                // 更新当前页码后，重新加载数据
                this.loadTableData();
            },
            loadTableData() {
                $.post('/index.php?s=/store/ditui.Dtuserok/index', {"isAjax":"yes",
                    "currentPage":this.currentPage, "pageSize": this.pageSize,
                    "formInline":this.formInline}, function (_res) {
                    _this.tableData = _res.data.list;
                    _this.totalItems = _res.data.allNum;
                    _this.callBackNum = _res.data.callBackNum;
                    if(_res.data.begTimeStr!=''){
                        _this.formInline.startTime = _res.data.begTimeStr;
                    }
                    if(_res.data.endTimeStr!=''){
                        _this.formInline.endTime = _res.data.endTimeStr;
                    }
                })
            },
            // 给学员添加课程，给学员删除课程
            addKe(opm){
                if(opm=='del'){
                    this.$prompt("请输入操作密码", "确定删除，删除后不可恢复？", {
                        confirmButtonText: "确定",
                        cancelButtonText: "取消",
                        inputPattern: /444444/,
                        type: "warning",
                        inputErrorMessage: "口令错误",
                    }).then(() => {
                        _this.addremoveKe(opm);
                    })
                }
                else{
                    this.addremoveKe(opm);
                }

            },
            addremoveKe(opm){
                $.post('/index.php?s=/store/ditui.Xiaoke/addKe', {"opm":opm, "dl_id":this.nowdl_id, "keId":this.nowKeId}, function (_res) {
                    if(opm=='del'){
                        window.location = window.location;
                    }
                    if(_res.code==0){
                        _this.$message.error(_res.msg);
                    }
                    else{
                        _this.nowPerSonKeArr = _res.data.list;
                        var newTableKeArr = [];
                        _this.nowPerSonKeArr.length>0 ? newTableKeArr=_this.nowPerSonKeArr[0]['ux_xiaoke_arr'] : "";

                        _this.tableData[_this.nowRowCnt]['ux_id'] = _this.nowPerSonKeArr.length>0 ? _res.data.addObj['ux_id'] : 0;
                        _this.tableData[_this.nowRowCnt]['kearr'] = newTableKeArr;
                        _this.tableData[_this.nowRowCnt]['ke_name'] = _this.nowPerSonKeArr.length>0 ? _this.nowPerSonKeArr[0]['keName'] : "未设置";
                        _this.$message({  message: _res.msg, type: 'success' });
                    }
                })
            },
            beforeUpload(file) {
                fullLoading = this.$loading({
                    lock: true,
                    text: 'Loading',
                    spinner: 'el-icon-loading',
                    background: 'rgba(0, 0, 0, 0.7)'
                });

                var back = true;
                console.log(file);
                if(file.name.indexOf('pldr_student')<0){
                    this.$message.error('请将数据写入模板文件中，再导入模板文件，名称必需一样');
                    back = false;
                }
                else{
                    const isLt2M = file.size / 1024 / 1024 < 2;
                    if (!isLt2M) {
                        this.$message.error('文件大小不能超过 2MB!');
                        back = false;
                    }
                }
                if(back==false){
                    if(fullLoading!=null){
                        fullLoading.close();
                    }
                }
                return back;
            },
            chooceFileOk(response, file, fileList) {
                console.log(response);
                fullLoading.close();
                if(response.code==1){
                    this.$message.success('学员批量上传成功');
                    window.location = window.location;
                }
                else{
                    this.$message.error('学员批量上传失败');
                }
                // if(this.beforeUpload(file)){
                //     var resData = response.data;
                //     this.fileList = fileList;
                //     console.log(this.fileList);
                // }
            }
        }
    });
</script>